package com.rightsidetech.system.mapper;

import com.rightsidetech.system.dtos.response.SysRuleCommodityPageResp;
import com.rightsidetech.system.dtos.response.SysRuleSpecsDetailResp;
import com.rightsidetech.system.entity.SysRuleCommodityIntegral;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SysRuleCommodityIntegralMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysRuleCommodityIntegral record);

    int insertSelective(SysRuleCommodityIntegral record);

    SysRuleCommodityIntegral selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysRuleCommodityIntegral record);

    int updateByPrimaryKey(SysRuleCommodityIntegral record);

    int insertList(Map<String, Object> map);

    Long selectCountByCommodityId(Long commodityId);

    List<SysRuleCommodityPageResp> selectPageList();

    List<SysRuleCommodityPageResp> selectListByParentId(Long id);

    List<SysRuleSpecsDetailResp> selectDetail(Long id);

    int delByParentId(Long id);

    int updateChileByParentId(@Param("id") Long id,@Param("ruleStatus") Byte ruleStatus);

    int updateRuleStatusById(@Param("id") Long id,@Param("ruleStatus") Byte ruleStatus);

    SysRuleCommodityIntegral selectByCommodityIdAndBarCode(@Param("commodityId") Long commodityId,@Param("barCode") String barCode);
}